* move floor from Qt 5.15 to 6.2.
* fix some CI failures
* try harder to fix coverage build
* try to fix coverage again
* try agin
* move up msvc tools minimum for Qt6
* clean up clazy warnings with Qt6.
* drop redundnant CI job
* revert translation related unintentionl changes
* simplify find qt packages
* assume Qt6 in textstream
* move CI tidy to noble
* assume Qt6 in textstream.h
* remove obsolete makesetup.bat
* remove Qt5 support from coretool
* strip Qt5 from noble image
* update default qt versions.
* update minimum cmake version to match Qt 6.2.4 QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_USING_QT
* assume QHash result is type size_t
* remove unnecessary qOverloads (in Qt6).
fail-fast: false
matrix:
include:
- - IMAGE: 'jammy'
- CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt5'
+ - IMAGE: 'noble'
+ CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt6'
SCRIPT: './tools/ci_run_tidy.sh'
container:
image: gpsbabel-docker.jfrog.io/tsteven4/gpsbabel_build_environment_${{ matrix.IMAGE }}
fail-fast: false
matrix:
include:
- - IMAGE: '35'
- CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt5'
- - IMAGE: '37'
- CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt5'
- IMAGE: '37'
CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt6'
- - IMAGE: '38'
- CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt5'
- IMAGE: '38'
CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt6'
- - IMAGE: '39'
- CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt5'
- IMAGE: '39'
CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt6'
- - IMAGE: '40'
- CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt5'
- IMAGE: '40'
CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt6'
container:
fail-fast: false
matrix:
include:
- - QT_VERSION: '5.15.2'
+ - QT_VERSION: '6.2.4'
XCODE_VERSION: '13.4.1'
GENERATOR: 'Ninja'
RELEASE: false
# focal has Qt 5.12, end of standard support 4/2025, end of life 4/2030.
#- IMAGE: 'focal'
# SCRIPT: './tools/build_and_test_cmake.sh'
- - IMAGE: 'jammy'
- CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt5'
- SCRIPT: './tools/build_and_test_cmake.sh'
- IMAGE: 'jammy'
CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt6'
SCRIPT: './tools/build_and_test_cmake.sh'
SCRIPT: './tools/build_and_test_cmake.sh'
TOOLS: 'clang'
- IMAGE: 'jammy'
- CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt5'
+ CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt6'
SCRIPT: './tools/build_extra_tests.sh'
container:
image: gpsbabel-docker.jfrog.io/tsteven4/gpsbabel_build_environment_${{ matrix.IMAGE }}
- name: install
run: |
sudo apt-get update
- sudo apt-get install gcovr lcov libusb-1.0-0-dev qtbase5-dev qtwebengine5-dev libqt5serialport5-dev ninja-build
+ sudo apt-get install gcovr lcov libusb-1.0-0-dev libgl-dev qt6-base-dev libqt6core5compat6-dev libqt6serialport6-dev qt6-webengine-dev qt6-webengine-dev-tools ninja-build
- name: Checkout repository
uses: actions/checkout@v4
fail-fast: false
matrix:
include:
- - QT_VERSION: '5.15.2'
- ARCH: 'amd64'
- HOST_ARCH: 'amd64'
- COMPILER: 'msvc2019_64'
- METHOD: 'aqt'
- GENERATOR: 'Visual Studio 16 2019'
- RELEASE: false
- os: windows-2019
- - QT_VERSION: '5.15.2'
- ARCH: 'amd64'
- HOST_ARCH: 'amd64'
- COMPILER: 'msvc2019_64'
- TOOLSET: 'v141,version=14.16.27023'
- METHOD: 'aqt'
- GENERATOR: 'Visual Studio 16 2019'
- RELEASE: false
- os: windows-2019
- - QT_VERSION: '5.15.2'
- ARCH: 'x86'
- HOST_ARCH: 'amd64'
- COMPILER: 'msvc2019'
- METHOD: 'aqt'
- GENERATOR: 'Visual Studio 16 2019'
- RELEASE: false
- os: windows-2019
- QT_VERSION: '6.2.4'
ARCH: 'amd64'
HOST_ARCH: 'amd64'
COMPILER: 'msvc2019_64'
+ TOOLSET: 'v142,version=14.29.30133'
METHOD: 'aqt'
GENERATOR: 'Visual Studio 16 2019'
RELEASE: false
-cmake_minimum_required(VERSION 3.11)
+cmake_minimum_required(VERSION 3.16)
include(CMakeDependentOption)
include(CheckIncludeFile)
add_executable(gpsbabel)
# Find the QtCore library
-find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
-find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
-list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Core)
-if(${Qt${QT_VERSION_MAJOR}Core_VERSION} VERSION_LESS 5.15)
- message(FATAL_ERROR "Qt version ${Qt${QT_VERSION_MAJOR}Core_VERSION} found, but version 5.15 or newer is required.")
+find_package(Qt6 REQUIRED COMPONENTS Core Core5Compat)
+list(APPEND QT_LIBRARIES Qt6::Core Qt6::Core5Compat)
+if(${Qt6Core_VERSION} VERSION_LESS 6.2)
+ message(FATAL_ERROR "Qt version ${Qt6Core_VERSION} found, but version 6.2 or newer is required.")
else()
- message(STATUS "Using Qt${QT_VERSION_MAJOR} version ${Qt${QT_VERSION_MAJOR}Core_VERSION}")
-endif()
-if(${QT_VERSION_MAJOR} EQUAL "6")
- find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core5Compat REQUIRED)
- list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Core5Compat)
+ message(STATUS "Using Qt6 version ${Qt6Core_VERSION}")
endif()
option(GPSBABEL_ENABLE_PCH "enable precompiled headers." ON)
rgbcolors.cc
route.cc
session.cc
+ src/core/codecdevice.cc
src/core/logging.cc
src/core/nvector.cc
src/core/textstream.cc
waypt.cc
xmlgeneric.cc
)
-if(${QT_VERSION_MAJOR} EQUAL "6")
- set(SUPPORT ${SUPPORT} src/core/codecdevice.cc)
-endif()
# HEADERS
set(HEADERS
jeeps/gpsusbcommon.h
jeeps/gpsusbint.h
jeeps/gpsutil.h
+ src/core/codecdevice.h
src/core/datetime.h
src/core/file.h
src/core/logging.h
src/core/xmlstreamwriter.h
src/core/xmltag.h
)
-if(${QT_VERSION_MAJOR} EQUAL "6")
- set(HEADERS ${HEADERS} src/core/codecdevice.h)
-endif()
string(REPLACE .cc .h FILTER_HEADERS "${FILTERS}")
set(HEADERS ${HEADERS} ${FILTER_HEADERS})
if(WIN32)
target_compile_definitions(gpsbabel PRIVATE __WIN32__)
- if(${QT_VERSION_MAJOR} EQUAL "6")
- qt_disable_unicode_defines(gpsbabel)
- endif()
+ qt_disable_unicode_defines(gpsbabel)
if(CMAKE_BUILD_TYPE STREQUAL Debug)
target_compile_definitions(gpsbabel PRIVATE _DEBUG)
endif()
translation files, i.e. gpsbabelfe_*.qm, gpsbabel_*.qm, as well as
gmapbase.html. When compiled in these files do not need to be distributed.
These are used by the GUI. Additional translation files from Qt will also be
-used if they are found. They may be in a package such as qttranslations5-l10n
-or qt5-qttranslations.
+used if they are found. They may be in a package such as qt6-translations-l10n.
*/
-#include <cassert> // for assert
#include <cmath> // for fabs
#include <cstdlib> // for strtod
#include <cstring> // for strlen, strchr, strncmp, strcmp, memmove, strcpy, strcspn, strncpy
#include <QByteArray> // for QByteArray
#include <QChar> // for QChar
#include <QDebug> // for QDebug
-#include <QRegularExpression> // for QRegularExpression
+#include <QList> // for QList
#include <QString> // for QString, operator+
#include "defs.h"
{
QString r = source;
if (!to_nuke.isEmpty()) {
- // avoid problematic regular rexpressions, e.g. xmapwpt generated [:\n:],
- // or one can imagine [0-9] when we meant the characters, '0', '-', and '9',
- // or one can imagine [^a] when we meant the characters '^' and 'a'.
- QRegularExpression regex = QRegularExpression(QStringLiteral("[%1]").arg(QRegularExpression::escape(to_nuke)));
- assert(regex.isValid());
- r.remove(regex);
+ auto isNukeable = [&to_nuke](const QChar &ch)->bool {
+ return to_nuke.contains(ch);
+ };
+ r.removeIf(isNukeable);
}
return r;
}
constexpr double unknown_alt = -99999999.0;
constexpr int unknown_color = -1;
-#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
-using qhash_result_t = uint;
-#else
-using qhash_result_t = size_t;
-#endif
-
#endif // DEFS_H_INCLUDED_
#include <QString> // for QString
#include <QStringView> // for QStringView
#include <QVector> // for QVector
-#include <QtGlobal> // for QT_VERSION, QT_VERSION_CHECK
#include "defs.h" // for arglist_t, Waypoint, route_head, ARGTYPE_BOOL, ARGTYPE_INT, ARG_NOMINMAX, bounds, FF_CAP_RW_ALL, ff_cap, ff_type, ff_type_file
#include "format.h" // for Format
public:
WptNamePosnKey(const QString& name, double lt, double ln) : shortname(name), lat(lt), lon(ln) {}
- friend qhash_result_t qHash(const WptNamePosnKey &c, qhash_result_t seed = 0) noexcept
+ friend size_t qHash(const WptNamePosnKey &c, size_t seed = 0) noexcept
{
-#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
return qHashMulti(seed, c.shortname.toUpper(), c.lat, c.lon);
-#else
- /*
- * As noted in above refeference
- * QtPrivate::QHashCombine is private API, but does not require any special buildsystem magic;
- * it’s in <qhashfunctions.h>, a public header.
- */
- QtPrivate::QHashCombine hash;
-
- seed = hash(seed, c.shortname.toUpper());
- seed = hash(seed, c.lat);
- seed = hash(seed, c.lon);
- return seed;
-#endif
}
QString shortname;
public:
WptNameKey(const QString& name) : shortname(name) {} /* converting constructor */
- friend qhash_result_t qHash(const WptNameKey &c, qhash_result_t seed = 0) noexcept
+ friend size_t qHash(const WptNameKey &c, size_t seed = 0) noexcept
{
return qHash(c.shortname.toUpper(), seed);
}
endif()
# Find the QtCore library
-find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
-find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Network SerialPort Widgets Xml REQUIRED)
-list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::SerialPort Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Xml)
-if(${Qt${QT_VERSION_MAJOR}Core_VERSION} VERSION_LESS 5.15)
- message(FATAL_ERROR "Qt version ${Qt${QT_VERSION_MAJOR}Core_VERSION} found, but version 5.15 or newer is required.")
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Network SerialPort Widgets Xml)
+list(APPEND QT_LIBRARIES Qt6::Core Qt6::Gui Qt6::Network Qt6::SerialPort Qt6::Widgets Qt6::Xml)
+if(${Qt6Core_VERSION} VERSION_LESS 6.2)
+ message(FATAL_ERROR "Qt version ${Qt6Core_VERSION} found, but version 6.2 or newer is required.")
else()
- message(STATUS "Using Qt${QT_VERSION_MAJOR} version ${Qt${QT_VERSION_MAJOR}Core_VERSION}")
+ message(STATUS "Using Qt6 version ${Qt6Core_VERSION}")
endif()
option(GPSBABEL_MAPPREVIEW "enable map preview." ON)
if (GPSBABEL_MAPPREVIEW)
- find_package(Qt${QT_VERSION_MAJOR} COMPONENTS WebEngineWidgets WebChannel REQUIRED)
- list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::WebEngineWidgets Qt${QT_VERSION_MAJOR}::WebChannel)
+ find_package(Qt6 REQUIRED COMPONENTS WebEngineWidgets WebChannel)
+ list(APPEND QT_LIBRARIES Qt6::WebEngineWidgets Qt6::WebChannel)
else()
target_compile_definitions(gpsbabelfe PRIVATE DISABLE_MAPPREVIEW)
endif()
get_target_property(IncDirs gpsbabelfe INCLUDE_DIRECTORIES)
message(STATUS "Include Directores are: \"${IncDirs}\"")
-find_package(Qt${QT_VERSION_MAJOR} QUIET COMPONENTS LinguistTools)
-if (NOT Qt${QT_VERSION_MAJOR}LinguistTools_FOUND)
- message(WARNING "Qt${QT_VERSION_MAJOR}LinguistTools not found, gpsbabelfe translations cannot be updated or released, and application cannot be packaged.")
+find_package(Qt6 QUIET COMPONENTS LinguistTools)
+if (NOT Qt6LinguistTools_FOUND)
+ message(WARNING "Qt6LinguistTools not found, gpsbabelfe translations cannot be updated or released, and application cannot be packaged.")
else()
# FIXME: translations updated and released in source directory (and under version control).
list(APPEND TRANSLATIONS gpsbabelfe_de.ts)
list(APPEND TRANSLATIONS gpsbabelfe_ru.ts)
add_custom_target(gpsbabelfe_lupdate
- COMMAND Qt${QT_VERSION_MAJOR}::lupdate ${SOURCES} ${FORMS} -ts ${TRANSLATIONS}
+ COMMAND Qt6::lupdate ${SOURCES} ${FORMS} -ts ${TRANSLATIONS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
VERBATIM
USES_TERMINAL)
add_custom_target(gpsbabelfe_lrelease
- COMMAND Qt${QT_VERSION_MAJOR}::lrelease ${TRANSLATIONS}
+ COMMAND Qt6::lrelease ${TRANSLATIONS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS gpsbabelfe_lupdate
VERBATIM
USES_TERMINAL)
if(APPLE)
- get_target_property(_qmake_executable Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)
+ get_target_property(_qmake_executable Qt6::qmake IMPORTED_LOCATION)
add_custom_target(package_app
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/package_app -a $<TARGET_BUNDLE_DIR:gpsbabelfe> -q ${_qmake_executable} -g $<TARGET_FILE:gpsbabel> -s ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_BUNDLE_DIR:gpsbabelfe>/../GPSBabelFE.dmg ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
USES_TERMINAL)
elseif(UNIX)
- get_target_property(_qmake_executable Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)
+ get_target_property(_qmake_executable Qt6::qmake IMPORTED_LOCATION)
add_custom_target(package_app
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/package_app -a $<TARGET_FILE_DIR:gpsbabelfe> -q ${_qmake_executable} -g $<TARGET_FILE:gpsbabel> -s ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS gpsbabelfe gpsbabel gpsbabelfe_lrelease coretool_lrelease
endif()
# in 5.12.12 cmake doesn't know about windeployqt, look in directory that has qmake.
- get_target_property(_qmake_executable Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)
+ get_target_property(_qmake_executable Qt6::qmake IMPORTED_LOCATION)
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
find_program(WINDEPLOYQT NAMES windeployqt PATHS "${_qt_bin_dir}" NO_DEFAULT_PATH)
if (WINDEPLOYQT STREQUAL "WINDEPLOYQT-NOTFOUND")
add_executable(coretool EXCLUDE_FROM_ALL)
-find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
-find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Widgets REQUIRED)
-list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Widgets)
+list(APPEND QT_LIBRARIES Qt6::Core Qt6::Widgets)
list(APPEND SOURCES ../formatload.cc)
list(APPEND SOURCES coretool.cc)
# FIXME: core_strings.h generated in source directory (and under version control).
# FIXME: translations updated and released in source directory (and under version control).
-get_target_property(_qmake_executable Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)
+get_target_property(_qmake_executable Qt6::qmake IMPORTED_LOCATION)
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/core_strings.h
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:gpsbabel> ${CMAKE_CURRENT_BINARY_DIR}
list(APPEND TRANSLATIONS gpsbabel_it.ts)
list(APPEND TRANSLATIONS gpsbabel_ru.ts)
-find_package(Qt${QT_VERSION_MAJOR} QUIET COMPONENTS LinguistTools)
-if(Qt${QT_VERSION_MAJOR}LinguistTools_FOUND)
+find_package(Qt6 QUIET COMPONENTS LinguistTools)
+if(Qt6LinguistTools_FOUND)
# The line numbers are almost meaningless the way we generate corestrings.h, and we force everything to the same context.
# With line numbers and the similartext heuristic enabled translations can be copied from an old message to a new message,
# and marked as unfinished. The threshold for similar is low.
# These will be used by the application, even though they really need to be checked.
# Disable the similartext heuristic to avoid these mistranslations.
add_custom_target(coretool_lupdate
- COMMAND Qt${QT_VERSION_MAJOR}::lupdate -disable-heuristic similartext core_strings.h -ts ${TRANSLATIONS}
+ COMMAND Qt6::lupdate -disable-heuristic similartext core_strings.h -ts ${TRANSLATIONS}
DEPENDS core_strings.h
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
VERBATIM
USES_TERMINAL)
add_custom_target(coretool_lrelease
- COMMAND Qt${QT_VERSION_MAJOR}::lrelease ${TRANSLATIONS}
+ COMMAND Qt6::lrelease ${TRANSLATIONS}
DEPENDS coretool_lupdate
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
VERBATIM
USES_TERMINAL)
else()
- message(WARNING "Qt${QT_VERSION_MAJOR}LinguistTools not found, coretool translations cannot be updated or released.")
+ message(WARNING "Qt6LinguistTools not found, coretool translations cannot be updated or released.")
endif()
// MIN_QT_VERSION in GPSBabel.pro should correspond to the QT_VERSION_CHECK
// arguments in main.cc and gui/main.cc and the version check in
// CMakeLists.txt, gui/CMakeLists.txt.
-#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
+#if (QT_VERSION < QT_VERSION_CHECK(6, 2, 0))
#error this version of Qt is not supported.
#endif
connect(ui_.actionUpgradeCheck, &QAction::triggered, this, &MainWindow::upgradeCheckActionX);
connect(ui_.actionPreferences, &QAction::triggered, this, &MainWindow::preferencesActionX);
-// TODO: Qt6 deleted the obsolete overloaded signal QComboBox::currentIndexChanged(const QString &text)
-// that required using qOverload.
- connect(ui_.inputFormatCombo, qOverload<int>(&QComboBox::currentIndexChanged),
+ connect(ui_.inputFormatCombo, &QComboBox::currentIndexChanged,
this, &MainWindow::inputFormatChanged);
-// TODO: Qt6 deleted the obsolete overloaded signal QComboBox::currentIndexChanged(const QString &text)
-// that required using qOverload.
- connect(ui_.outputFormatCombo, qOverload<int>(&QComboBox::currentIndexChanged),
+ connect(ui_.outputFormatCombo, &QComboBox::currentIndexChanged,
this, &MainWindow::outputFormatChanged);
connect(ui_.inputOptionsBtn, &QAbstractButton::clicked,
this, &MainWindow::inputOptionButtonClicked);
const QStringList directories = {
QApplication::applicationDirPath() + "/translations",
":/translations",
-#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
- QLibraryInfo::location(QLibraryInfo::TranslationsPath)
-#else
QLibraryInfo::path(QLibraryInfo::TranslationsPath)
-#endif
};
// Load the new translator.
+++ /dev/null
-rem $Id: makesetup.bat,v 1.2 2010-06-27 21:13:07 robertl Exp $\r
-rem \r
-rem Copy the Qt stuff into a local directory. The Inno Setup compiler\r
-rem cannot handle %QTDIR environment variable in the source file\r
-rem specification\r
-\r
-echo off\r
-rd /q /s qtdir\r
-mkdir qtdir\r
-mkdir qtdir\bin\r
-mkdir qtdir\translations\r
-mkdir qtdir\plugins\r
-mkdir qtdir\plugins\imageformats\r
-mkdir qtdir\plugins\platforms\r
-mkdir qtdir\mingw\r
-\r
-rem Basic Qt runtime DLLs\r
-rem if "%QTDIR%"=="" call \QtSDK\Desktop\Qt\4.7.4\mingw\bin\qtenv2.bat\r
-rem if "%QTDIR%"=="" call \Qt\Qt5.2.1\5.2.1\mingw48_32\bin\qtenv2.bat\r
-if "%QTDIR%"=="" set QTDIR=c:\Qt\Qt5.2.1\5.2.1\mingw48_32\r
-copy %QTDIR%\bin\icu*.dll qtdir\bin\r
-copy %QTDIR%\bin\libgcc_s_dw2-1.dll qtdir\bin\r
-copy %QTDIR%\bin\libstdc*.dll qtdir\bin\r
-copy %QTDIR%\bin\libwinpthread*.dll qtdir\bin\r
-copy %QTDIR%\bin\Qt5Core.dll qtdir\bin\r
-copy %QTDIR%\bin\Qt5Gui.dll qtdir\bin\r
-copy %QTDIR%\bin\Qt5Multimedia.dll qtdir\bin\r
-copy %QTDIR%\bin\Qt5MultimediaWidgets.dll qtdir\bin\r
-copy %QTDIR%\bin\Qt5Network.dll qtdir\bin\r
-copy %QTDIR%\bin\Qt5OpenGL.dll qtdir\bin\r
-copy %QTDIR%\bin\Qt5Positioning.dll qtdir\bin\r
-copy %QTDIR%\bin\Qt5PrintSupport.dll qtdir\bin\r
-copy %QTDIR%\bin\Qt5Qml.dll qtdir\bin\r
-copy %QTDIR%\bin\Qt5Quick.dll qtdir\bin\r
-copy %QTDIR%\bin\Qt5Sensors.dll qtdir\bin\r
-copy %QTDIR%\bin\Qt5Sql.dll qtdir\bin\r
-copy %QTDIR%\bin\Qt5Webkit.dll qtdir\bin\r
-copy %QTDIR%\bin\Qt5WebkitWidgets.dll qtdir\bin\r
-copy %QTDIR%\bin\Qt5Widgets.dll qtdir\bin\r
-copy %QTDIR%\bin\Qt5Xml.dll qtdir\bin\r
-\r
-rem Image format plugins needed at runtime, but not debug verions\r
-xcopy %QTDIR%\plugins\imageformats qtdir\plugins\imageformats\r
-xcopy %QTDIR%\plugins\platforms qtdir\plugins\platforms\r
-rem del qtdir\plugins\imageformats\*d4*.dll\r
-rem del qtdir\plugins\imageformats\lib*d4*.a\r
-\r
-rem Mingw runtime support\r
-copy %QTDIR%\..\mingw\bin\mingwm10.dll qtdir\mingw\r
-\r
-rem Copy QT's own translations (Apply/OK, and the like)\r
-copy %QTDIR%\translations\qt_*.qm qtdir\translations\r
-del qtdir\translations\qt_help*\r
-\r
-rem Generate the compiled translations. All of this makes sense only if\r
-rem the you're doing releases strictly \r
-rem copy %QTDIR%\translations\qt_*.ts qtdir\translations\r
-rem lrelease gpsbabel_de.ts\r
-rem lrelease gpsbabel_es.ts\r
-rem lrelease gpsbabel_fr.ts\r
-rem lrelease gpsbabel_hu.ts\r
-rem lrelease gpsbabel_it.ts\r
-rem lrelease gpsbabelfe_de.ts\r
-rem lrelease gpsbabelfe_es.ts\r
-rem lrelease gpsbabelfe_fr.ts\r
-rem lrelease gpsbabelfe_hu.ts\r
-rem lrelease gpsbabelfe_it.ts\r
-rem lrelease gpsbabelfe_ru.ts\r
-rem for /f %%a in (dir /b *.ts) do lrelease %%a\r
-\r
-"c:\Program Files\Inno Setup 5\ISCC.exe" setup.iss\r
-\r
-rem cleanup\r
-rd /q /s qtdir\r
-rem del gpsbabel_*.qm\r
-rem del gpsbabelfe_*.qm\r
#include "runmachine.h"
-#include <QDebug> // for qDebug
-#include <QEventLoop> // for QEventLoop
-#include <QNonConstOverload> // for QNonConstOverload
-#include <QtGlobal> // for QOverload, qOverload
-#include <QDialog> // for QDialog
+#include <QDebug> // for operator<<, QDebug
+#include <QEventLoop> // for QEventLoop
+#include <Qt> // for QueuedConnection
+#include <QtGlobal> // for qDebug
-#include "appname.h" // for appName
+#include "appname.h" // for appName
QString RunMachine::decodeProcessError(QProcess::ProcessError err)
std::nullopt,
std::nullopt);
}, Qt::QueuedConnection);
- // TODO: Qt6 combined the obsolete overloaded signal QProcess::finished(int exitCode)
- connect(process_, qOverload<int, QProcess::ExitStatus>(&QProcess::finished),
+ connect(process_, &QProcess::finished,
this, [this](int exitCode, QProcess::ExitStatus exitStatus) {
execute(processFinished,
std::nullopt,
#ifndef RUNMACHINE_H
#define RUNMACHINE_H
-#include <QObject> // for QObject
-#include <QProcess> // for QProcess, QProcess::ExitStatus, QProcess::ProcessError, qt_getEnumName
-#include <QString> // for QString
-#include <QStringList> // for QStringList
-#include <QWidget> // for QWidget
+#include <QList> // for QList
+#include <QObject> // for Q_ENUM, Q_OBJECT, Q_SIGNALS
+#include <QProcess> // for QProcess, QProcess::ProcessError, QProcess::ExitStatus
+#include <QString> // for QString
+#include <QStringList> // for QStringList
+#include <QWidget> // for QWidget
-#include <optional> // for optional, nullopt
+#include <optional> // for optional
-#include "processwait.h" // for ProcessWaitDialog
+#include "processwait.h" // for ProcessWaitDialog
class RunMachine : public QWidget
// Qt5 doesn't have a qHash function for scoped enumerations.
// Qt6 falls back to std::hash, but it may not use the seed.
- friend qhash_result_t qHash(const igc_ext_type_t& key, qhash_result_t seed = 0) noexcept
+ friend size_t qHash(const igc_ext_type_t& key, size_t seed = 0) noexcept
{
return qHash(static_cast<std::underlying_type<igc_ext_type_t>::type>(key), seed);
}
#include <QHash> // for QHash
#include <QIODevice> // for QIODevice::ReadOnly, QIODevice
#include <QTextStream> // for QTextStream
-#include <QtGlobal> // for qEnvironmentVariable, qPrintable, QT_VERSION, QT_VERSION_CHECK
+#include <QtGlobal> // for qEnvironmentVariable, qPrintable
#include <utility>
#define MYNAME "inifile"
gpsbabel::File file(name);
file.open(QFile::ReadOnly);
QTextStream stream(&file);
-#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
- // default for QTextStream::setCodec in Qt5 is QTextCodec::codecForLocale()
// default for QTextStream::setEncoding in Qt6 is QStringConverter::Utf8
- stream.setCodec("UTF-8");
-#endif
stream.setAutoDetectUnicode(true);
auto* result = new inifile_t;
// MIN_QT_VERSION in GPSBabel.pro should correspond to the QT_VERSION_CHECK
// arguments in main.cc and gui/main.cc and the version check in
// CMakeLists.txt, gui/CMakeLists.txt.
-#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
+#if (QT_VERSION < QT_VERSION_CHECK(6, 2, 0))
#error This version of Qt is not supported.
#endif
-#if defined(_MSC_VER) && (_MSC_VER < 1910) /* MSVC 2015 or earlier */
-#error MSVC 2015 and earlier are not supported. Please use MSVC 2017 or MSVC 2019.
+#if defined(_MSC_VER) && (_MSC_VER < 1920) /* MSVC 2017 or earlier */
+#error MSVC 2017 and earlier are not supported. Please use MSVC 2019 or MSVC 2022.
#endif
if constexpr (DEBUG_LOCALE) {
public:
ShortNameKey(const QByteArray& name) : shortname(name) {} /* converting constructor */
- friend qhash_result_t qHash(const ShortNameKey& key, qhash_result_t seed = 0) noexcept
+ friend size_t qHash(const ShortNameKey& key, size_t seed = 0) noexcept
{
// We hash all strings as upper case.
return qHash(key.shortname.toUpper(), seed);
neighborhood goner = errormap.last();
goner.wpt->wpt_flags.marked_for_deletion = 1;
// errormap.remove(lastKey()); // with Qt 5.12.12, 5.15.2 results in asan heap-use-after-free errors in build_extra_tests.sh
- errormap.erase(std::prev(errormap.end())); // in Qt6 can use cend().
+ errormap.erase(std::prev(errormap.cend())); // in Qt6 can use cend().
// wpthash.remove(goner.wpt); // removal not necessary
/* recompute neighbors of point marked for deletion. */
*/
-#include <QtGlobal> // for qint64, QT_VERSION, QT_VERSION_CHECK
+#include <QtGlobal> // for qint64
-#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
#include <QByteArrayView> // for QByteArrayView
-#endif
#include <QFile> // for QFile
#include <QFlags> // for QFlags
#include <QIODevice> // for QIODevice
-#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
#include <QIODeviceBase> // for QIODeviceBase::OpenMode
#include <QStringConverter> // for QStringConverter, QStringConverter::Utf8, QStringConverter::Encoding, QStringConverter::Utf16
-#endif
-#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
#include <optional> // for optional
-#endif
#include "defs.h" // for fatal, list_codecs
#include "src/core/textstream.h"
void TextStream::open(const QString& fname, QIODevice::OpenMode mode, const char* module, const char* codec_name)
{
-#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
- codec_ = QTextCodec::codecForName(codec_name);
- if (codec_ == nullptr) {
- list_codecs();
- fatal("%s: Unsupported codec '%s'.\n", module, codec_name);
- }
-
- file_ = new gpsbabel::File(fname);
- file_->open(mode);
- setDevice(file_);
- setCodec(codec_);
-
- if (mode & QFile::ReadOnly) {
- if (codec_->mibEnum() == 106) { // UTF-8
- setAutoDetectUnicode(true);
- }
- }
-
- if (mode & QFile::WriteOnly) {
- // enable bom for all UTF codecs except UTF-8
- if (codec_->mibEnum() != 106) {
- setGenerateByteOrderMark(true);
- }
- }
-#else
std::optional<QStringConverter::Encoding> encoding = QStringConverter::encodingForName(codec_name);
bool use_stringconverter = encoding.has_value();
setDevice(device_);
setEncoding(QStringConverter::Utf16);
}
-#endif
}
void TextStream::close()
delete file_;
file_ = nullptr;
}
-#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
- codec_ = nullptr;
-#else
if (device_ != nullptr) {
device_->close();
delete device_;
device_ = nullptr;
}
-#endif
}
} // namespace gpsbabel
#ifndef SRC_CORE_TEXTSTREAM_INCLUDED_H_
#define SRC_CORE_TEXTSTREAM_INCLUDED_H_
-#include <QtGlobal> // for QT_VERSION, QT_VERSION_CHECK
#include <QIODevice> // for QIODevice
-#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
#include <QIODeviceBase> // for QIODeviceBase::OpenMode
-#endif
#include <QString> // for QString
-#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
-#include <QTextCodec> // for QTextCodec
-#endif
#include <QTextStream> // for QTextStream
-#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
#include "src/core/codecdevice.h" // for CodecDevice
-#endif
#include "src/core/file.h" // for File
private:
gpsbabel::File* file_{nullptr};
-#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
- QTextCodec* codec_{nullptr};
-#else
gpsbabel::CodecDevice* device_{nullptr};
-#endif
};
} // namespace gpsbabel
libudev-dev \
&& rm -rf /var/lib/apt/lists/*
-# pkgs with qt used by gpsbabel
-RUN apt-get update && apt-get install -y --no-install-recommends \
- qtbase5-dev \
- qttools5-dev \
- qttranslations5-l10n \
- qtwebengine5-dev \
- libqt5serialport5-dev \
- && rm -rf /var/lib/apt/lists/*
-
# pkgs with qt used by gpsbabel
RUN apt-get update && apt-get install -y --no-install-recommends \
qt6-base-dev \
)
}
-QT_VERSION=${1:-5.15.2}
+QT_VERSION=${1:-6.5.3}
COMPILER=${2:-msvc2019_64}
METHOD=${3:-default}
# and https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt\r
\r
Param(\r
- [string] $qtdir = "C:\Qt\Qt5.15.2\5.15.2\msvc2019_64",\r
+ [string] $qtdir = "C:\Qt\6.5.3\msvc2019_64",\r
[ValidateSet("x86", "amd64")][string] $arch = "amd64",\r
[ValidateSet("x86", "amd64")][string] $host_arch = "amd64",\r
[string] $vcversion\r
QList<Waypoint*> buff;
- auto it = track_list.begin();
- while (it != track_list.end()) { /* put all points into temp buffer */
+ auto it = track_list.cbegin();
+ while (it != track_list.cend()) { /* put all points into temp buffer */
route_head* track = *it;
// steal all the wpts
WaypointList wpts;
delete wpt;
}
}
- if (it != track_list.begin()) {
+ if (it != track_list.cbegin()) {
track_del_head(track);
- it = track_list.erase(it);
+ it = static_cast<RouteList::const_iterator>(track_list.erase(it));
} else {
++it;
}
int original_waypt_count = track_waypt_count();
- auto it = track_list.begin();
- while (it != track_list.end()) {
+ auto it = track_list.cbegin();
+ while (it != track_list.cend()) {
route_head* track = *it;
foreach (Waypoint* wpt, track->waypoint_list) {
if (track->rte_waypt_empty()) {
track_del_head(track);
- it = track_list.erase(it);
+ it = static_cast<RouteList::const_iterator>(track_list.erase(it));
} else {
++it;
}
translation files, i.e. gpsbabelfe_*.qm, gpsbabel_*.qm, as well as
gmapbase.html. When compiled in these files do not need to be distributed.
These are used by the GUI. Additional translation files from Qt will also be
-used if they are found. They may be in a package such as qttranslations5-l10n
-or qt5-qttranslations.
+used if they are found. They may be in a package such as qt6-translations-l10n.
</para>
</section>
</section>